package mumethod;

import java.sql.Date;
import java.util.List;

import mudbconnection.*;
import muobject.*;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component("AccessSchoolsService")
public class AccessSchoolsService implements AccessSchools {
	@Autowired
	private DBSchools dbClasses;
	private List<School> schools;
	private School school;
	
	public List<School> getAllClasses() {
		schools = dbClasses.getAllSchools();
		return schools;
	}

	public School getTopClasses() {
		schools = dbClasses.getAllSchools();
		return schools.get(0);
	}
	
	public School getSchoolBySno(String sno){
		school = dbClasses.getSchoolBySno(sno);
		return school;
	}

	public boolean updateSchools(School school) {
		try {
			dbClasses.setSpicalSidSchools(school);
			return true;
		} catch (Exception e) {
			System.out.println(e.getMessage());
			return false;
		}
	}
	
}
